﻿@model GuRenFang.Service.Entity.Photos
@{   
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<link href="@Url.Content("~/Scripts/Uploadify/uploadify.css")" rel="stylesheet" type="text/css" />
<style type="text/css">
.gallery li img 
{
    height:90px;
    width:160px;
 }
</style>
<div class="grid_12 widget first">
    <div class="widget_title clearfix">
        <h2>
            上传新图片至首页</h2>
    </div>
    <div class="widget_body">
        @using (Html.BeginForm())
        {
            
            <table class="simple">
                <tbody>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.Title):
                        </td>
                        <td colspan="2">
                            @Html.TextBoxFor(model => model.Title, new { style = "width:613px" })
                            <br />@Html.ValidationMessageFor(model => model.Title)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.Content):
                        </td>
                        <td colspan="2">
                            @Html.TextAreaFor(model => model.Content, new { rows = "5", id = "news-content", style = "width: 613px;height:100px" })
                            <br />@Html.ValidationMessageFor(model => model.Content)
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <label for="photos">
                                选择要上传的图片【图片大小：宽568px*高400px】：</label>
                        </td>
                        <td rowspan="3" style="width: 280px; vertical-align: top; color: Red; font-weight: bold"> 
                            
                            @Html.ValidationSummary(true)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.HiddenFor(model => model.ImgPath)
                            @Html.HiddenFor(model => model.ThumbnailPath)
                        </td>
                        <td>
                            <p>
                                <input id="fileInput1" name="fileInput1" type="file" /></p>
                            <p style="margin-top: 5px; font-size: 14px; font-weight: bold;">
                                <span id="result"></span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <a href="javascript:if(checkImport()){$('#fileInput1').uploadifyUpload();}" class="btn  large grey">
                                上传图片</a>
                            <input type="submit" value="【保 存】" id="submit" />
                        </td>
                    </tr>
                </tbody>
            </table>
        }
    </div>
</div>
<div class="grid_4 widget">
    <div class="widget_title clearfix">
        <h2>
            图片预览</h2>
    </div>
    <div class="widget_body">
        <div class="widget_content">
            <ul class="gallery">
                <li><a title="" href="#" rel="prettyPhoto[HomePage]" id="previewLink">
                    <img alt="" src="#" id="previewImage" /></a> </li>
                <div class="clear">
                </div>
            </ul>
        </div>
    </div>
</div>
<div class="clear">
    <div id="dialog" title="提示">
        <p>
            请先上传图片!</p>
    </div>
</div>
@{Html.RenderPartial("_HomePageImagesScript");}
